<template>
  <div class="wrapper" :style="setStyles">
    {{dataString}}
  </div>
</template>

<script>
/**
 * @说明
 * 组件应该通过props 暴露部分出去
 * 利于 编辑
 */
export default {
  name: 'VText',
  props: {
    // 
    width: {
      type: [String, Number]
    },
    height: {
      type: [String, Number]
    },
    color: {
      type: [String, Number]
    },
    fontSize: {
      type: [String, Number]
    },
    data: {
      type: String,
    }

  },
  data() {
    return {
      dataString: JSON.parse(this.data).text
    }
  },
  methods: {},
  created() {
    console.log('我生成了', this.dataString);
  },
  mounted() { },
  computed: {
    setStyles() {
      return {
        width: this.width + 'px',
        height: this.height + 'px',
        color: this.color,
        fontSize: this.fontSize + 'px',
      }
    }
  }
}
</script>

<style lang="less" scoped>
.wrapper {
}
</style>